import java.util.Random;
import java.util.Scanner;

public class Main {
    //求一个整数，在内存当中存储时，二进制1的个数。
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int a = scn.nextInt();
        int flag = 0;
        int rem;
        for(int i = 1; i <= 16; i++) {
            rem = a % 2;
            a /=  2;
            if(rem == 1) {
                flag++;
            }
            if(a == 1) {
                flag++;
                break;
            }
            else if( a == 0) {
                break;
            }
        }
        System.out.println(flag);
    }
    //编写程序数一下 1到 100 的所有整数中出现多少个数字9
    public static void main7(String[] args) {
        int sum = 0;
        int ret = 0;
        for(int i = 1; i <= 100; i++) {
            if(i % 10 == 9) {
                sum++;
            }
            if(i > 10) {
                ret = i / 10;
                if(ret % 10 == 9){
                    sum++;
                }
            }
        }
        System.out.println(sum);
    }
    //输出 1000 - 2000 之间所有的闰年
    public static void main6(String[] args) {
        for (int i = 1000; i <= 2000; i++) {
            if((i % 4 == 0 && i % 100 != 0) || i % 400 == 0) {
                System.out.print(i+"  ");
            }
        }

    }
    //打印1-100之间素数
    public static void main5(String[] args) {
        System.out.print("1 2 ");
        for(int j = 3; j <= 100; j++) {
            boolean flag = true;
            for( int i = 2; i < j; i++) {
                if(j % i == 0) {
                    flag = false;
                }
            }
            if(flag) {
                System.out.print(j+" ");
            }
        }

    }
    //判定素数
    public static void main4(String[] args) {
        Scanner scn = new Scanner(System.in);
        int a = scn.nextInt();
        boolean flag = true;
        for( int i = 2; i < a; i++) {
            if(a % i == 0) {
                flag = false;
            }
        }
        if(flag) {
            System.out.println(a+"是素数 ");
        }
        else {
            System.out.println(a+"不是素数 ");
        }
    }

    public static void main3(String[] args) {
        Scanner scn = new Scanner(System.in);
        Random random = new Random();
        int randomNumber = random.nextInt(100);
        System.out.println(randomNumber);
        String name = scn.nextLine();
        System.out.println(name);
    }
    public static void main2(String[] args) {
        int i = 1;
        while(i <= 100) {
            if(i % 3 != 0 || i % 5 != 0) {
                i++;
                continue;
            }
            System.out.println(i);
            i++;
        }
    }
    public static void main1(String[] args) {
        int a = 10;
        System.out.println(a);
        System.out.println(Integer.MIN_VALUE);
        System.out.println(Integer.MAX_VALUE);
        char ch = '啦';
        System.out.println(ch);
        byte m = 88;
        System.out.println(m);
        boolean bool = false;
        System.out.println(bool);
        char c = 'a';
        System.out.println(c);
         String str = "kkkkkkkkkk";
         String ret =String.valueOf(a);
        System.out.println(ret);
        System.out.println(str+c+ch+(a+m));
        System.out.println(10%2.3);
    }
}